<div class="container">
	<div class="row row-offcanvas row-offcanvas-right">
		<div class="col-xs-6 col-sm-3">
			<div class="well sidebar-nav">
				<ul class="nav">
					<li><a href="<?= WEB_PATH?>/admin/phone">Manage phone</a></li>
					<li><a href="<?= WEB_PATH?>/admin/catagory">Manage catagory</a></li>
					<li><a href="<?= WEB_PATH?>/admin/feedback">Manage feedback</a></li>
					<li><a href="<?= WEB_PATH?>/admin/banner">Manage banner</a></li>
					<li><a href="<?= WEB_PATH?>/admin/order">Manage order</a></li>
					<li><a href="<?= WEB_PATH?>/admin/customer">Manage customer</a></li>
				</ul>
			</div>
		</div>
		<!--/span-->

		<div class="col-xs-12 col-sm-9 sidebar-offcanvas" id="sidebar" >
			<form action="" method="post">
			<table class="table">
			 	<tr class="active">
			 		<td>Mã số</td>
			 		<td><?=$this->order->id?></td>
			 	</tr>
			 	<tr class="">
			 		<td>Tên khách hàng</td>
			 		<td><?=$this->order->customer_name?></td>
			 	</tr>
			 	<tr class="active">
			 		<td>SĐT</td>
			 		<td><input value="<?=$this->order->phone?>" class="form-control" name="phone"></td>
			 	</tr>
			 	<tr class="">
			 		<td>Địa chỉ</td>
			 		<td><input value="<?=$this->order->address?>" class="form-control" name="address"></td>
			 	</tr>
			 	<tr class="active">
			 		<td>Trạng thái</td>
			 		<td>
			 			<select name="status">
							<option <?=$this->order->status == 'Mới' ? 'selected' : ''?> value="Mới">Mới</option>
							<option <?=$this->order->status == 'Đã xác nhận' ? 'selected' : ''?> value="Đã xác nhận">Đã xác nhận</option>
							<option <?=$this->order->status == 'Đang giao hàng' ? 'selected' : ''?> value="Đang giao hàng">Đang giao hàng</option>
							<option <?=$this->order->status == 'Hoàn thành' ? 'selected' : ''?> value="Hoàn thành">Hoàn thành</option>
			 			</select>
			 	</tr>
				<tr>
					<td colspan="2">
						<table class="table">
							<tr>
								<th>STT</th>
								<th colspan="2">Sản phầm</th>
								<th>Số Lượng</th>
								<th>Thành tiền</th>
							</tr>
							<?php $total = 0;?>
							<?php foreach($this->orderDetails as $key => $orderDetail) {?>
								<?php if ($orderDetail->quantity > 0) {?>
									<tr class="<?= $key % 2 == 0? 'success' : ''?>">
										<td> <?= $key + 1?>	</td>
										<td> <div class="product-small-image"><img src="<?=WEB_PATH?>/public/imgs/<?=$orderDetail->findParentRow('Application_Model_DbTable_Phone')->image_url?>" class="img-max-width"></div></td>				
										<td> <?= $orderDetail->findParentRow('Application_Model_DbTable_Phone')->name?></td>				
										<td> <input value="<?= $orderDetail->quantity?>" type="number" min="0" name="quantity[<?=$orderDetail->id?>]"> </td>				
										<td> <?php 
												 $subTotal = $orderDetail->quantity * $orderDetail->price;
												 $total += $subTotal;
												 echo $subTotal;
												 ?></td>				
									</tr>
								<?php }?>
							<?php }?>
							<tr>
								<td colspan="4" ><h4 class="pull-right">Tổng cộng:</h4></td>
								<td><h4><?php echo $total?></h4></td>
								<td></td>
							</tr>
							<tr>
								<td colspan="4" ><button type="submit" class="btn btn-success pull-right">Chỉnh sửa</button></td>
								<td><a class="btn btn-success" href="<?=WEB_PATH?>/admin/order">Trở lại</a></td>
								<td></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			</form>
			<!--/.well -->
		</div>
		<!--/span-->

	</div>
	<!--/row-->
	
	
	<hr>

	<footer>
		<p>&copy; Company 2013</p>
	</footer>
</div>

<!--/.container-->